package com.zlyx.easy.jedis.supports;

import com.zlyx.easy.asyn.supports.AsynMsgSender;
import com.zlyx.easy.asyn.utils.MsgUtils;
import com.zlyx.easy.jedis.utils.JedisUtils;

/**
 * @Auth 赵光
 * @Describle
 * @2019年9月7日
 */
public class JedisMsgSender implements AsynMsgSender {

	private String jedisChannelKey;

	public JedisMsgSender(String jedisChannelKey) {
		this.jedisChannelKey = jedisChannelKey;
	}

	@Override
	public void doQuque(String channel, String msg) {
		throw new UnsupportedOperationException("不支持QUEUE消息类型");
	}

	@Override
	public void doTopic(String channel, String msg) {
		JedisUtils.publish(jedisChannelKey, MsgUtils.newMessage(channel, msg));
	}

}
